﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WorkStation.Frameworks.EasyBus.Attributes;

namespace WorkStation.Frameworks.EasyBus.Test.PublishMessages
{
    [Publish(RouteKey = "EasyBus.TestPublish", Description = "测试发布消息")]
    public class TestPublishMessage
    {
        public string Name { get; set; }
    }

    [Subscribe(Name = "EasyBus.UnitTest.SubscribeTestA", RouteKey = "EasyBus.TestPublish", BusName = "TestBus", Description = "测试订阅消息", Mq = "RabbitMq:HostName=localhost;Port=5672;VirtualHost=/;UserName=guest;Password=guest;QueueName=TestQueue;IsSynchronization=false")]
    [Subscribe(Name = "EasyBus.UnitTest.SubscribeTestMsmqA", RouteKey = "EasyBus.TestPublish", BusName = "TestBus", Mq = @"Msmq:Address=.\EasyBus.TestQueue;IsSynchronization=false")]
    [Listener(SubscribeName = "EasyBus.UnitTest.SubscribeTestA", HandleName = "HandleA;HandleB", ProcessThreadCount = 1)]
    [Listener(SubscribeName = "EasyBus.UnitTest.SubscribeTestMsmqA", HandleName = "HandleA;HandleB", ProcessThreadCount = 1)]
    public class TestSubscribeMessage 
    {
        public string Name { get; set; }
    }

    [Publish(RouteKey = "EasyBus.TestConfigPublish", Description = "测试配置文件发布消息")]
    public class TestConfigPublishMessage
    {
        public string Name { get; set; }
    }

    [Subscribe(Name = "EasyBus.UnitTest.SubscribeB", RouteKey = "EasyBus.TestConfigPublish", BusName = "TestBus", Mq = "Config:ConfigMq")]
    [Listener(SubscribeName = "EasyBus.UnitTest.SubscribeB", HandleName = "HandleA;HandleB", ProcessThreadCount = 1)]
    public class TestConfigSubscribeMessage 
    {
        public string Name { get; set; }
    }

    // [Subscribe(RouteKey = "EasyBus.TestPublish", BusName = "TestBus", Description = "测试订阅消息", Mq = "Config:EndpointName=SubscribeEndpointA;Config:EndpointName=SubscribeEndpointB")]

    // <endpoint name="SubscriteEndpointA" value="RabbitMq:HostName=10.32.33.140;Port=5672;VirtualHost=/;UserName=songxd;Password=123abc;QueueName=TestQueueA">
    // <endpoint name="SubscriteEndpointB" value="RabbitMq:HostName=10.32.33.140;Port=5672;VirtualHost=/;UserName=songxd;Password=123abc;QueueName=TestQueueB">

    // <listener processThreadCount="3" mq-name="SubscriteEndpointA">
    //  <process routeKey="EasyBus.TestPublish">
    //   <handleName>HandleA</handleName>
    //   <handleName>HandleB</handleName>
    //  </process>
    // </listener>

    // <publish routeKey="EasyBus.TestPublish" description="测试发布消息" />

    // <subscribe routeKey="EasyBus.TestPublish" busName="TestBus" description="测试订阅消息">
    //  <mq-list>
    //   <mq name="SubscriteEndpointA" />
    //   <mq name="SubscriteEndpointB" />
    //  </mq-list>
    // </subscribe>
}
